package com.zhu.tool_test.comment.config;

import com.zhu.tool_test.comment.LinuxCondition;
import com.zhu.tool_test.comment.WindowsCondition;
import com.zhu.tool_test.entity.Book;
import com.zhu.tool_test.entity.Device;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @program: tool_test
 * @description: condition配置类
 * @author: ggBall
 * @create: 2021-01-11 18:28
 **/
@Configuration
public class ConditionConfig {


        @Conditional(WindowsCondition.class)
        @Bean("book")
        public Book book(){
            return new Book("1","windows");
        }

        @Conditional(LinuxCondition.class)
        @Bean("Linus")
        public Device device(){
            return new Device();
        }

}
